function imageCache() {
     var srcs = $api.domAll('.list_img img');

     if (srcs.length > 0 ) {
         for (var i = 0; i < srcs.length; i++) {
             (function(obj){
              src = $api.attr(obj,'src');

             url= $api.attr(obj, 'src') ;
         console.log(url);
             if(url!=''){
                 api.imageCache({
                     url: url
                 }, function(ret, err){
                     if( ret ){

                          $api.attr(obj, 'src', localStorage.getItem('domain')+ret.url);

                     }
                 });
                 }

             })(srcs[i]);
         }
     }
 }



 function _zyzImgCache(){
                var imgDir = "fs://images/";
                var srcs = $("img.imgCache");

                if(srcs.length > 0){
                    var imgObj = $("img.imgCache").first();
                        var imgUrl = localStorage.getItem('domain')+imgObj.attr("srcs");
                        var imgMd5 = $.md5(imgUrl);

                        var fs = api.require('fs');
                        fs.exist({
                            path: imgDir + imgMd5
                        },function(ret,err){
                            if(ret.exist){
                                imgObj.attr("src",api.fsDir+"/images/"+imgMd5);
                                imgObj.removeClass("imgCache");
                                _zyzImgCache();
                            }else {

                                    api.download({
                                            url : imgUrl,
                                            savePath : imgDir+imgMd5,
                                            report : false,
                                            cache : true,
                                            allowResume : true
                                        }, function(ret, err) {
 console.log(JSON.stringify( imgUrl  ));
                                            if (ret) {
                                                    imgObj.attr("src",ret.savePath);
                                                    imgObj.removeClass("imgCache");
                                                    _zyzImgCache();
                                            } else {
                                                var value = err.msg;
                                            };
                                    });
                            }
                        });
                }
        }
